package com.study.group.common.utils;

public class EncryptUtil {
	/**
	 * 用于身份证掩码、少量手机号掩码
	 * @param resoureStr
	 * @param start
	 * @param end
	 * @param encryptChar
	 * @return
	 */
	public static String encrypt(String resoureStr,Integer start,Integer end,char encryptChar) {
		String encryptStr = "";
		if(null!=resoureStr){
			StringBuilder encrypt = new StringBuilder(resoureStr);
			StringBuilder star = new StringBuilder();
			for (int i = 0; i < end-start; i++) {
				star.append(encryptChar);
			}
			encryptStr = encrypt.replace(start, end, star.toString()).toString();
		}
		return encryptStr;
	}

	/**
	 * 用于大部分手机号掩码
	 * @return
	 */
	public static String encrypt() {
		return "***********";
	}
}
